rendernode: draw() only in node bounds
authorTimm Bäder <mail@baedert.org>
Wed, 12 Feb 2020 15:21:38 +0000 (16:21 +0100)
committerTimm Bäder <mail@baedert.org>
Wed, 12 Feb 2020 15:54:46 +0000 (16:54 +0100)
We currently disable when draw()ing nodes using the cairo fallback path,
which means we can't just use cairo_paint(). Use a proper rectangle
instead.

Fixes #2431

gsk/gskrendernodeimpl.c

index 2434c5d40e2b7ace235d803143f632628ff9a53d..a6957ff657c87dcbb8ae24b062487507e038eb5f 100644 (file)
@@ -651,7 +651,10 @@ gsk_texture_node_draw (GskRenderNode *node,
   pattern = cairo_pattern_create_for_surface (surface);
   cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
   cairo_set_source (cr, pattern);
-  cairo_paint (cr);
+  cairo_rectangle (cr,
+                   0, 0,
+                   gdk_texture_get_width (self->texture), gdk_texture_get_height (self->texture));
+  cairo_fill (cr);
 
   cairo_restore (cr);
 
@@ -2549,7 +2552,10 @@ gsk_repeat_node_draw (GskRenderNode *node,
                             });
 
   cairo_set_source (cr, pattern);
-  cairo_paint (cr);
+  cairo_rectangle (cr,
+                   node->bounds.origin.x, node->bounds.origin.y,
+                   node->bounds.size.width, node->bounds.size.height);
+  cairo_fill (cr);
 
   cairo_pattern_destroy (pattern);
   cairo_surface_destroy (surface);
@@ -3821,7 +3827,10 @@ gsk_blur_node_draw (GskRenderNode *node,
   cairo_surface_unmap_image (surface, image_surface);
 
   cairo_set_source (cr, pattern);
-  cairo_paint (cr);
+  cairo_rectangle (cr,
+                   node->bounds.origin.x, node->bounds.origin.y,
+                   node->bounds.size.width, node->bounds.size.height);
+  cairo_fill (cr);
 
   cairo_restore (cr);
   cairo_pattern_destroy (pattern);